package cn.edu.neu.dao;

import cn.edu.neu.model.Category;
import cn.edu.neu.model.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HomeDao {
    @Select("select * from t_goods order by goods_sales desc limit 5")
    List<Goods> getHotList();
    @Select("select * from t_category where cate_id in(select cate_id from t_goods group by cate_id having count(goods_id)>0)")
    List<Category> getList();
    @Select("SELECT * from t_goods where cate_id=#{cateId} order by goods_date desc limit 3")
    List<Goods> getListByCateID(String cateId);
}
